package com.wlr.blog.article.service.impl;

import com.wlr.blog.article.service.JobService;
import com.wlr.blog.job.ScheduleUtils;
import com.wlr.blog.job.SysJob;
import org.quartz.Scheduler;
import org.springframework.stereotype.Service;

/**
 * @author lrwang
 * @version 1.0
 * @date 2022/11/22 13:43
 */
@Service("jobServiceImpl")
public class JobServiceImpl implements JobService {
    @Override
    public void start(SysJob job) {
        try {
            Scheduler scheduleJob = ScheduleUtils.createScheduleJob(job);
            ScheduleUtils.startScheduleJob(scheduleJob);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
